<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head th:include="student/common :: commonhead">
    <!--<div th:replace="student/common :: commonhead"></div>-->
</head>
<head>
    <title>添加课程</title>
    <!--这里写这个页面单独需要的css-->
    <!--pickers css-->
    <link rel="stylesheet" type="text/css" href="js/bootstrap-datepicker/css/datepicker-custom.css"
          th:href="@{/js/bootstrap-datepicker/css/datepicker-custom.css}"/>
    <link rel="stylesheet" type="text/css" href="js/bootstrap-timepicker/css/timepicker.css"
          th:href="@{/js/bootstrap-timepicker/css/timepicker.css}"/>
    <link rel="stylesheet" type="text/css" href="js/bootstrap-colorpicker/css/colorpicker.css"
          th:href="@{/js/bootstrap-colorpicker/css/colorpicker.css}"/>
    <link rel="stylesheet" type="text/css" href="js/bootstrap-daterangepicker/daterangepicker-bs3.css"
          th:href="@{/js/bootstrap-daterangepicker/daterangepicker-bs3.css}"/>
    <link rel="stylesheet" type="text/css" href="js/bootstrap-datetimepicker/css/datetimepicker-custom.css"
          th:href="@{/js/bootstrap-datetimepicker/css/datetimepicker-custom.css}"/>
</head>
<body class="sticky-header">

<section>
    <!--  引入左侧边  -->
    <div th:replace="student/common :: left"></div>

    <div class="main-content">
        <div th:replace="student/common :: header-section"></div>
        <!--这里开始写东西-->
        <div class="wrapper">

                <div class="row">
                    <div class="col-md-12">
                        <section class="panel">
                            <header class="panel-heading">
                                发布作业
                                <span class="tools pull-right">
                            <a class="fa fa-chevron-down" href="javascript:;"></a>
                            <a class="fa fa-times" href="javascript:;"></a>
                            </span>
                            </header>
                            <div class="panel-body">
                                <form th:action="@{/teacher/addHomework}" class="form-horizontal " method="post">

                                    <input type="hidden" name="couId" th:value="${couId}">
                                    <input type="hidden" name="teaId" th:value="${teaId}">

                                    <div class="form-group">
                                        <label class="col-sm-1 col-sm-1 control-label">标题 ：</label>
                                        <div class="col-sm-4">
                                            <input type="text" class="form-control" name="hwTitle">
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-1 col-sm-1 control-label">开始时间 ：</label>
                                        <div class="col-sm-4">
                                            <input type="datetime-local" class="form-control" name="start" id="beginDate">
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-1 col-sm-1 control-label">截止时间 ：</label>
                                        <div class="col-sm-4">
                                            <input type="datetime-local" class="form-control" name="end" id="endDate">
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-1 col-sm-1 control-label">满分 ：</label>
                                        <div class="col-sm-4">
                                            <input type="text" class="form-control" name="hwFullMark" min="0" max="100">
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-1 col-sm-1 control-label">作业要求 ：</label>
                                        <div class="col-md-12">
                                            <textarea class="wysihtml5 form-control" rows="9" name="hwQuestion"></textarea>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <div class="col-lg-offset-11 col-lg-10">
                                            <button class="btn btn-primary" type="submit">发布</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </section>
                    </div>
                </div>

        </div>
    </div>
</section>

<div th:replace="student/common :: commonjs"></div>

<!--pickers plugins-->
<script type="text/javascript" src="js/bootstrap-datepicker/js/bootstrap-datepicker.js"
        th:src="@{/js/bootstrap-datepicker/js/bootstrap-datepicker.js}"></script>
<script type="text/javascript" src="js/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js"
        th:src="@{/js/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js}"></script>
<script type="text/javascript" src="js/bootstrap-daterangepicker/moment.min.js"
        th:src="@{/js/bootstrap-daterangepicker/moment.min.js}"></script>
<script type="text/javascript" src="js/bootstrap-daterangepicker/daterangepicker.js"
        th:src="@{/js/bootstrap-daterangepicker/daterangepicker.js}"></script>
<script type="text/javascript" src="js/bootstrap-colorpicker/js/bootstrap-colorpicker.js"
        th:src="@{/js/bootstrap-colorpicker/js/bootstrap-colorpicker.js}"></script>
<script type="text/javascript" src="js/bootstrap-timepicker/js/bootstrap-timepicker.js"
        th:src="@{/js/bootstrap-timepicker/js/bootstrap-timepicker.js}"></script>

<!--pickers initialization-->
<script src="js/pickers-init.js" th:src="@{/js/pickers-init.js}"></script>
<script>
    function check() {
        var beginDate = $("#beginDate").val();
        var endDate = $("#endDate").val();
        var d1 = new Date(beginDate.replace(/\-/g, "\/"));
        var d2 = new Date(endDate.replace(/\-/g, "\/"));
        if (beginDate != "" && endDate != "" && d1 >= d2) {
            alert("开始时间不能大于结束时间！");
            return false;
        }
        return true;
    }
</script>
</body>
</html>